package com.road7.mina.customcodecfactory;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

/**
 * @Description :
 * @FileName: ProtobufStrictCodecFactory.java
 * @Author :WeiHui.Zhang
 * @Data : 2015年11月23日 下午8:22:59
 * @Version:V1.00
 */
public class ProtobufStrictCodecFactory implements ProtocolCodecFactory {

	private final ProtobufStrictEncoder encoder;
	private final ProtobufStrictDecoder decoder;

	public ProtobufStrictCodecFactory() {
		encoder = new ProtobufStrictEncoder();
		decoder = new ProtobufStrictDecoder();
	}

	public ProtocolEncoder getEncoder(IoSession session) throws Exception {
		return encoder;
	}

	public ProtocolDecoder getDecoder(IoSession session) throws Exception {
		return decoder;
	}

}
